<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>login</title>
    <script src="js/jquery-3.3.1.js"></script>
</head>
<body>
    <form>
        username:<input name="username"><br>
        password:<input name="password"><br>
        <input type="button" value="login" onclick="login()">
    </form>
    <script>
        function login() {
            var username = $('form input[name="username"]').val();
            var password = $('form input[name="password"]').val();
            $.ajax({
                url: "/security/login",
                type: "post",
                dataType: "json",
                headers: {
                    Authorization: "Basic YXBwOmFwcHNlY3JldA=="
                },
                data: {
                    username: username,
                    password: password
                },
                success: function (data) {
                    console.log(data);
                },
                error: function (data) {
                    console.log(data)
                }
            })
        }
    </script>
</body>
</html>